﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Castle.MicroKernel.Registration;

using Dinamico.Service;
using AutoMapper;
using Dinamico.Models;

namespace Dinamico
{
    public class WindsorInstaller : IWindsorInstaller
    {

        public void Install(Castle.Windsor.IWindsorContainer container, Castle.MicroKernel.SubSystems.Configuration.IConfigurationStore store)
        {
            InitializeMapping();
            container.Register(
                Component.For<IBasketService>()
                .ImplementedBy<BasketService>()
            );
            container.Register(
             Component.For<IMailService>()
             .ImplementedBy<SmtpMailService>()
            );
            container.Register(
             Component.For<ILogger>()
             .ImplementedBy<NLogLogger>()
            );
        }

        private void InitializeMapping() {
            //Mapper.CreateMap<BasketItemModel, ArticleOutputModel>();
            //Mapper.CreateMap<ArticleData, ArticleModel>();
            //Mapper.CreateMap<BasketItemModel, ArticleOutputModel>();
        }

    }
}